package com.qk.management.mapper;

import com.qk.entity.Role;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author 16778
 * @date 2025/10/7 12:56
 * @description
 */
@Mapper
public interface RoleMapper {
    List<Role> page(String name, String label, Integer page, Integer pageSize);

    @Insert("insert into role(name,label,remark,create_time,update_time) values(#{name},#{label},#{remark},#{createTime},#{updateTime})")
    void insert(Role role);

    @Delete("delete from role where id = #{id}")
    void deleteById(Integer id);

    @Select("select * from role where id = #{id}")
    Role selectById(Integer id);

    @Update("update role set name=#{name},label=#{label},remark=#{remark},update_time=#{updateTime} where id = #{id}")
    void update(Role role);

    @Select("Select * from role")
    List<Role> findAll();
}
